# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Scheduling do
  @moduledoc """
  All parameters related to queuing and scheduling of custom jobs.

  ## Attributes

  *   `disableRetries` (*type:* `boolean()`, *default:* `nil`) - Optional. Indicates if the job should retry for internal errors after the job starts running. If true, overrides `Scheduling.restart_job_on_worker_restart` to false.
  *   `maxWaitDuration` (*type:* `String.t`, *default:* `nil`) - Optional. This is the maximum duration that a job will wait for the requested resources to be provisioned if the scheduling strategy is set to [Strategy.DWS_FLEX_START]. If set to 0, the job will wait indefinitely. The default is 24 hours.
  *   `restartJobOnWorkerRestart` (*type:* `boolean()`, *default:* `nil`) - Optional. Restarts the entire CustomJob if a worker gets restarted. This feature can be used by distributed training jobs that are not resilient to workers leaving and joining a job.
  *   `strategy` (*type:* `String.t`, *default:* `nil`) - Optional. This determines which type of scheduling strategy to use.
  *   `timeout` (*type:* `String.t`, *default:* `nil`) - Optional. The maximum job running time. The default is 7 days.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :disableRetries => boolean() | nil,
          :maxWaitDuration => String.t() | nil,
          :restartJobOnWorkerRestart => boolean() | nil,
          :strategy => String.t() | nil,
          :timeout => String.t() | nil
        }

  field(:disableRetries)
  field(:maxWaitDuration)
  field(:restartJobOnWorkerRestart)
  field(:strategy)
  field(:timeout)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Scheduling do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Scheduling.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1Scheduling do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
